﻿using CTP.CRM.Core.Email.Options;
using Microsoft.CodeAnalysis.Emit;

namespace CTP.CRM.Core.Email
{
    public static class EmailServiceCollectionExtensions
    {
        public static IServiceCollection AddEmail(this IServiceCollection services, Action<EmailOptions> action)
        {
            EmailOptions emailOptions = new EmailOptions();
            action(emailOptions);
            EmailHelper.Init(emailOptions);
            return services;
        }
    }
}
